import { XtxRecommandInstance } from "@/types/component";
import { ref } from "vue";

// 推荐商品组件hook
export const useXtxRecommand = () => {
    // 组件实例
    const xtxRecommandRef = ref<XtxRecommandInstance>();

    // 触底加载事件
    const xtxRecommandLoadMore = async () => {
        await xtxRecommandRef.value?.loadMore();
    };

    // 下拉刷新事件
    const xtxRecommandRefresh = async () => {
        await xtxRecommandRef.value?.onRefresh();
    };

    return { xtxRecommandRef, xtxRecommandLoadMore, xtxRecommandRefresh };
};